<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
  <title>登录</title>
  <link rel="icon" href="http://www.wclimb.site/images/avatar.png">
	<script src="https://unpkg.com/jquery@3.3.1/dist/jquery.min.js"></script>
</head>
<bod>
    <div>setArticle</div>
    <div>
        文章名：<input placeholder="请输入文章名" type="text" name="name">
        内容：<input placeholder="请输入内容" type="text" name="content">
    </div>
    <button class='submit'>提交</button>
    
  
</bod>
</html>
<script>
  $(function(){
			$('.submit').click(function(){
				$.ajax({
          url: "/article/save",
          data: {
            name: $('input[name=name]').val(),
            content:$('input[name=content]').val()
					},
					type: "POST",
					cache: false,
					dataType: 'json',
					success: function (result) {
						console.log('success',result)
						if(result.code == 200){
							window.location.href='/home'
						}
					},
					error: function (error) {
            alert('异常');
            console.log('success',error)
					}
				})
			})
		})
</script>